package com.example.telesys.service.impl;

import com.example.telesys.TrafficService;
import com.example.telesys.mapper.TrafficMapper;
import com.example.telesys.pojo.Traffic;
import com.example.telesys.pojo.TrafficExample;
import com.example.telesys.utils.UuidUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TrafficServiceImpl implements TrafficService {

    @Autowired
    private TrafficMapper trafficMapper;

    @Override
    public List<Traffic> selectAllTraffic() {
        return trafficMapper.selectByExample(null);
    }

    @Override
    public Traffic selectTrafficById(String trafficid) {
        TrafficExample trafficExample = new TrafficExample();
        TrafficExample.Criteria criteria = trafficExample.createCriteria();
        criteria.andTrafficidEqualTo(trafficid);
        return trafficMapper.selectByExample(trafficExample).get(0);
    }
}
